package com.project.web.intfc.controller.app;

import com.project.common.web.utils.config.prop.PropAttributes;
import com.project.common.web.utils.config.prop.PropConfig;
import com.project.web.intfc.controller.common.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.yun.common.utils.redis.RedisClient;

/**
 * @Description:
 * @Auther: WYY
 * @Date: 2019/4/21 17:08
 */
@Controller("demoController")
@RequestMapping("/demo")
public class DemoController extends BaseController {

    @Autowired
    public RedisClient redisClient;


    @RequestMapping("/redis")
    @ResponseBody
    public void testRedis(@Value("${system.platform.version}")String version) {
        System.out.println(PropConfig.getProperty(PropAttributes.SYSTEM_SERVICE_DATAID));
        System.out.println(PropConfig.getProperty(PropAttributes.THIRDPARTY_WX_H5_WAP_NAME));

        redisClient.set("name", "admin123");
        Object name = redisClient.get("name");
        System.out.println(name.toString());
    }

    @RequestMapping("/login")
    public String testRedis(Model model) {
        System.out.println("1231231");
        return  "/intfc/login.ftl";
    }
}
